package com.kxf.androidtestdemo.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * @ProjectName: AndroidTestDemo
 * @Package: com.kxf.androidtestdemo.adapter
 * @ClassName: MyFragmentPageAdapter
 * @Description: java类作用描述
 * @Author: kuangxuefeng
 * @qq: 1024883177
 * @CreateDate: 2020/12/1 16:03
 */
public class MyFragmentPageAdapter extends FragmentPagerAdapter {

    private ArrayList<Fragment> fragments = null;

    public MyFragmentPageAdapter(@NonNull FragmentManager fm, int behavior, ArrayList<Fragment> fragments) {
        super(fm, behavior);
        this.fragments = fragments;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
